Neurosis Engine
Classes | Public Member Functions | Private Attributes
CNeurosisNetwork Class Reference

#include <network.h>

List of all members.

Classes

struct  CNetworkData

Public Member Functions

 CNeurosisNetwork (int maxConnections, int bufferSize)
 ~CNeurosisNetwork ()
 Constructor/Deconstructor.
char * Buffer_Retrieve (int iConnection)
 Retrieve buffer data.
void Buffer_Store (int iConnection, char *data)
 Store buffer data.
bool Check_For_Clients (int iConnection)
 Search for incoming connections.
int Close_Socket (int iConnection)
 Attempt to close socket.
bool Connect_To_Server (int iConnection, char *ip, int portNumber, bool isIPAddress)
 Open connection to server.
int Get_Socket (int iConnection)
 Returns socket used.
bool Initialize_Server (int iConnection, int portNumber)
 Initialize server connection.
bool In_Use (int iConnection)
 Returns connection availability.
int Recv (int iConnection, char *data, bool blocking)
 Receive data from connection.
bool Recv_File (int iConnection, char *filename)
 Receive file from connection.
void Recv_String (int iConnection)
 Receive string from connection (to buffer)
int Send (int iConnection, char *data, int dataSize, bool sendImmediately)
 Send data to buffer - sendImmediately will also send buffer.
bool Send_File (int iConnection, char *filename)
 Send file to connection.
void Send_String (int iConnection)
 Send string to connection (from buffer)

Private Attributes

CNetworkDatapNetwork
int mBufferSize
int mMaxConnections

Detailed Description

Note: Buffer automatically gets sent if over bufferSize value. Note: bufferSize should be made large enough to store any data sent/recv.


Constructor & Destructor Documentation

CNeurosisNetwork::CNeurosisNetwork ( int  maxConnections,
int  bufferSize 
)

Constructor/Deconstructor.


Member Function Documentation

char* CNeurosisNetwork::Buffer_Retrieve ( int  iConnection)

Retrieve buffer data.

void CNeurosisNetwork::Buffer_Store ( int  iConnection,
char *  data 
)

Store buffer data.

bool CNeurosisNetwork::Check_For_Clients ( int  iConnection)

Search for incoming connections.

int CNeurosisNetwork::Close_Socket ( int  iConnection)

Attempt to close socket.

bool CNeurosisNetwork::Connect_To_Server ( int  iConnection,
char *  ip,
int  portNumber,
bool  isIPAddress 
)

Open connection to server.

int CNeurosisNetwork::Get_Socket ( int  iConnection)

Returns socket used.

bool CNeurosisNetwork::In_Use ( int  iConnection)

Returns connection availability.

bool CNeurosisNetwork::Initialize_Server ( int  iConnection,
int  portNumber 
)

Initialize server connection.

int CNeurosisNetwork::Recv ( int  iConnection,
char *  data,
bool  blocking 
)

Receive data from connection.

bool CNeurosisNetwork::Recv_File ( int  iConnection,
char *  filename 
)

Receive file from connection.

void CNeurosisNetwork::Recv_String ( int  iConnection)

Receive string from connection (to buffer)

int CNeurosisNetwork::Send ( int  iConnection,
char *  data,
int  dataSize,
bool  sendImmediately 
)

Send data to buffer - sendImmediately will also send buffer.

bool CNeurosisNetwork::Send_File ( int  iConnection,
char *  filename 
)

Send file to connection.

void CNeurosisNetwork::Send_String ( int  iConnection)

Send string to connection (from buffer)


Member Data Documentation


The documentation for this class was generated from the following file: